
// 系统重置工具
const resetSystem = () => {
  try {
    // 清除所有存储数据
    wx.clearStorageSync();
    
    // 重置全局数据
    const app = getApp();
    app.globalData = {
      userInfo: null,
      location: null,
      settings: {
        range: 1,
        visibility: {
          province: false,
          city: false,
          district: true,
          street: true
        },
        region: ['浙江省', '杭州市', '上城区', '丁桥街道'],
        postContent: '老乡见老乡，两眼泪汪汪！'
      },
      tempSettings: {}
    };
    
    console.log('系统已重置');
    return true;
  } catch (e) {
    console.error('重置失败:', e);
    return false;
  }
};

module.exports = resetSystem;